package mvcdemo.controller;

import com.nf.mvc.exception.ExceptionHandler;
import com.nf.mvc.view.JsonViewResult;

public class GlobalExceptionHandler {
    @ExceptionHandler(RuntimeException.class)
    public JsonViewResult handleRuntime(RuntimeException re){
        System.out.println("re = " + re);
        return new JsonViewResult(new ResponseVo(10001,"订单超时，，，","runtime--"));
    }

    @ExceptionHandler(ArithmeticException.class)
    public JsonViewResult handleArithmeticException(ArithmeticException re){
        System.out.println("算术 re = " + re);
        return new JsonViewResult(new ResponseVo(10002,"asdas","算术--"));
    }
}
